using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Pheonix.Fashionzoomer.BLL;
using Pheonix.CodeLibrary.Web;

public partial class page_public_activation : BasePage
{
    private void VerifyUserAccount()
    {
        try
        {
            string confirmationCode = HttpUtility.UrlDecode(Request["confirmationCode"]);

            CurrentUser currentUser = new CurrentUser();
            if (UserManager.VerifyAccount(confirmationCode, out currentUser))
            {
                verificationResult.Text = @"Your account has been successfully verified. Thank you for 
                                            registration";

                SessionManager.LoggedUser = currentUser;
            }
            else
                verificationResult.Text = @"Invalid verification request. We do not have any record 
                                            regarding your account. May be your verification code expired. 
                                            Verification code expires in 7 days.";
        }
        catch (Exception ex)
        {
            verificationResult.Text = @"Invalid verification request. We do not have any record 
                                            regarding your account. May be your verification code expired. 
                                            Verification code expires in 7 days.";
        }
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        Title = SiteName + " - Account Activation";

        if (!IsPostBack)
            VerifyUserAccount();
    }
}
